import request from '@/plugins/axios'

export function fetchList(query) {
  return request({
    url: '/api/lessorpayable/page',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/api/lessorpayable',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/api/lessorpayable/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/api/lessorpayable/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/api/lessorpayable',
    method: 'put',
    data: obj
  })
}
//合同基本信息
export function getLessorContractPageList(query) {
    return request({
        url: '/api/lessorpayable/getLessorContractPageList',
        method: 'get',
        params: query
    })
}
//应付页合同信息
export function lessorContractList() {
    return request({
        url: '/api/lessorpayable/lessorContractList',
        method: 'get'
    })
}
//应付提交
export function updateLessorPayableByCommit(id) {
    return request({
        url: '/api/lessorpayable/updateLessorPayableByCommit/' + id,
        method: 'get'
    })
}
//审批
export function Approve(data) {
    return request({
        url: '/api/lessorpayable/updateLessorPayableByCommit',
        method: 'post',
        data: {},
        params: data
    })
}
//判断是否能应付调整
export function isAdjustment(id) {
    return request({
        url: '/api/lessorpayableadjustment/isAdjustment/' + id,
        method: 'get'
    })
}
//新增付款管理-应付调整台账
export function addAdjustment(obj) {
    return request({
        url: '/api/lessorpayableadjustment',
        method: 'post',
        data: obj
    })
}
//应付调整分页
export function adjustmentPage(query) {
    return request({
        url: '/api/lessorpayableadjustment/page',
        method: 'get',
        params: query
    })
}
//应付调整提交
export function updatePayableAdjustmentByCommit(id) {
    return request({
        url: '/api/lessorpayableadjustment/updatePayableAdjustmentByCommit/' + id,
        method: 'get'
    })
}
//应付调整审批
export function ApproveByAdjustment(data) {
    return request({
        url: '/api/lessorpayableadjustment/updatePayableAdjustmentByAdjustment',
        method: 'post',
        data: {},
        params: data
    })
}
//操作记录
export function getApprovalRecord(id) {
    return request({
        url: '/api/commonapprovalrecord/' + id,
        method: 'get'
    })
}

export function getAdjustment(id) {
    return request({
        url: '/api/lessorpayableadjustment/' + id,
        method: 'get'
    })
}
// 判断是否能应付调整或者复核通过
export function changeAdjustment(id) {
    return request({
        url: '/api/lessorbill/getBillByPaybleIds/' + id,
        method: 'get'
    })
}
